﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using Telerik.Windows.Controls;

namespace DiagnosticCenter.View
{
    public partial class viewOperator : Page
    {
        public viewOperator()
        {
            InitializeComponent();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            tabHomeO.MouseLeftButtonUp += tabClick_MouseLeftButtonUp;
            tabTestsO.MouseLeftButtonUp += tabClick_MouseLeftButtonUp;
            tabSessionO.MouseLeftButtonUp += tabClick_MouseLeftButtonUp;
            tabResultsO.MouseLeftButtonUp += tabClick_MouseLeftButtonUp;
            tabStudentsO.MouseLeftButtonUp += tabClick_MouseLeftButtonUp;
            operatorFrame.Navigate(new Uri("/View/viewOperatorProfile.xaml", UriKind.Relative));
        }

        private void tabClick_MouseLeftButtonUp(object sender, RoutedEventArgs e)
        {
            var tabItem = (RadTabItem)sender;
            switch (tabItem.Name)
            {
                case "tabHomeO": operatorFrame.Navigate(new Uri("/View/viewOperatorProfile.xaml", UriKind.Relative)); break;
                case "tabTestsO": operatorFrame.Navigate(new Uri("/View/viewOperatorTestManager.xaml", UriKind.Relative)); break;
                case "tabSessionO": operatorFrame.Navigate(new Uri("/View/viewOperatorSchedule.xaml", UriKind.Relative)); break;
                case "tabResults": operatorFrame.Navigate(new Uri("/View/viewStudentResults.xaml", UriKind.Relative)); break;
                case "tabStudentsO": operatorFrame.Navigate(new Uri("/View/viewOperatorUsers.xaml", UriKind.Relative)); break;
            }
        }
                 
    }
}
